#load "unix.cma";;
#load "graphics.cma";;
#load "bplib.cma";;

#load "maptypes.cmo";;
#load "parserMop.cmo";;
#load "lexerMop.cmo";;

#load "bopmapimp.cmo";;

open Maptypes
open Bopmapimp

let t = multi_parse "myfile.mop";;

let (_, def1) = List.hd t.defines;;

let it = MapItem.make def1;;

let p_ident id = String.make id ' '

let repr repr_a =
  let rec repr_option = function
    | None -> "None"
    | Some a -> repr_a a
  and repr_struct ident = function
    | (opts, optet, tree) ->
	Printf.sprintf "%sStr : (%s - %s\n%s%s)" (p_ident ident) (repr_option opts) (repr_option optet) (repr_tree (succ ident) (p_ident ident) tree)
  and repr_tree ident = function
    | Nil -> "Nil"
    | Tree t -> "Tree"

let print fct t =
  
  let rec print_str t = function
    | (st, etoi, dic) ->
  and print_tree = function
    | Nil -> "Nil"
    | Tree charMap ->
	let iter c 

  in print_str t;;
  
